﻿/*----------------------------------------------------------------
    // Copyright (C) 2009 江苏华招网
    // 版权所有。 
    // 作者：马毅
    //
    // 文件名：RelationQuery.cs
    // 文件功能描述：转配送管理
    // 创建标识：马毅2009-05-12
    //
    // 修改标识： 
    // 修改描述： 
    //
    // 修改标识： 
    // 修改描述： 
    //
    // 审核人： 
    // 审核时间： 
    // 审核说明： 
 //----------------------------------------------------------------*/
using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HZ.DrugTrade.Web;
using HZ.DrugTrade.Model;
using HZ.DrugTrade.IBLL;
using HZ.DrugTrade.BLLFactory;
using HZ.DrugTrade.Model.Enum;
namespace HZ.DrugTrade.Web.Enterprise.RelationQuery
{
    public partial class RelationQuery :  BasePage
    {
        public RelationQuery()
        { }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BangdinGvRelaion();
               
            }
        }

        protected void btnQuery_Click(object sender, EventArgs e)
        {
            AspNetPager1.CurrentPageIndex = 1;
            BangdinGvRelaion();
        }
        /// <summary>
        /// 绑定事件
        /// </summary>
        private void BangdinGvRelaion()
        {
            HZ.DrugTrade.Model.Query.AreaDistribution  aDistributionManage = new HZ.DrugTrade.Model.Query.AreaDistribution();
            aDistributionManage.CompanyID_PS = CurrentAccount.GetUser().Org.OrgID;
            aDistributionManage.GoodsName = txtGoodsName.Text.Trim();
            aDistributionManage.Material = txtMaterial.Text.Trim();
            aDistributionManage.Outlookc = txtOutlookc.Text.Trim();
            aDistributionManage.Unit = txtUnit.Text.Trim();
            aDistributionManage.SortFields = " goodsname desc ";
            GvRelaion.AutoGenerateColumns = false;
            int totalrecord = 0;
            //AspNetPager1.PageSize = Constants.GRIDVIEW_PAGE_SIZE;
            IBLL_Distribution iDistribution = Factory.BLL_Distribution();
            this.GvRelaion.DataSource = iDistribution.GetAreaDistribution(aDistributionManage, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out totalrecord);
            GvRelaion.DataBind();
            AspNetPager1.RecordCount = totalrecord;
        }
        protected void AspNetPager1_OnPageChanged(object sender, EventArgs e)
        {
            BangdinGvRelaion();
        }
    }
}
